<?php

// called from index function of main_interface.php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
//  \Doctrine\Common\Util\Debug::dump($data);
echo "</br></br>";

echo "</br>MAIN_displayfamily_view</br>";

$whichfamily = $_SESSION['active_family'];
$family = $this->doctrine->em->find('ORM\Dynasties2\Families', $whichfamily);
echo "You are logged in as the <b>" . $family->getFamilyName() . "</b> family.</br></br>";

$current_turn = '1';

foreach ($data as $key => $row) {
    
    //echo ($row->getName()) . ($row->getId());
    $name = $row -> getCharacterName();
    $born_turn = $row -> getBornDate();
    $married_to = $row-> getMarriedTo();
    $is_female = $row -> getIsFemale();
    
    $abs_diff = abs($current_turn - $born_turn);
    //echo $test_diff . " - " . $born_turn;
    $age = $abs_diff / 8;
    
    echo "   > " . $name . ", aged " . $age . " years, born on turn " . $born_turn . ".";
    echo "</br>";
}


